home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dynarec / form1.frm < prev    next >
Text File  |  1998-10-31  |  9KB  |  279 lines

  1. VERSION 5.00
  2. Object = "*\A..\..\codeV1\DynaRecord.vbp"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Test DynaRec VB5"
  6.    ClientHeight    =   4650
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4650
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4650
  14.    ScaleWidth      =   4650
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.Timer Timer1 
  18.       Interval        =   1
  19.       Left            =   4080
  20.       Top             =   1200
  21.    End
  22.    Begin VB.Frame Frame2 
  23.       Caption         =   "Error returned"
  24.       Height          =   975
  25.       Left            =   0
  26.       TabIndex        =   5
  27.       Top             =   3600
  28.       Width           =   3855
  29.       Begin VB.Label Label2 
  30.          Caption         =   "Label2"
  31.          Height          =   615
  32.          Left            =   120
  33.          TabIndex        =   6
  34.          Top             =   240
  35.          Width           =   3615
  36.       End
  37.    End
  38.    Begin VB.Frame Frame1 
  39.       Caption         =   "Control"
  40.       Height          =   3615
  41.       Left            =   0
  42.       TabIndex        =   0
  43.       Top             =   0
  44.       Width           =   3855
  45.       Begin VB.ComboBox Combo3 
  46.          Height          =   315
  47.          Left            =   1680
  48.          Style           =   2  'Dropdown List
  49.          TabIndex        =   12
  50.          Top             =   1680
  51.          Width           =   1815
  52.       End
  53.       Begin VB.ComboBox Combo2 
  54.          Height          =   315
  55.          Left            =   1680
  56.          Style           =   2  'Dropdown List
  57.          TabIndex        =   11
  58.          Top             =   1320
  59.          Width           =   1815
  60.       End
  61.       Begin VB.ComboBox Combo1 
  62.          Height          =   315
  63.          Left            =   1680
  64.          Style           =   2  'Dropdown List
  65.          TabIndex        =   10
  66.          Top             =   960
  67.          Width           =   1815
  68.       End
  69.       Begin VB.CommandButton Command2 
  70.          Caption         =   "Stop Record"
  71.          Height          =   375
  72.          Left            =   2040
  73.          TabIndex        =   4
  74.          Top             =   2160
  75.          Width           =   1215
  76.       End
  77.       Begin VB.CommandButton Command1 
  78.          Caption         =   "RECORD"
  79.          Height          =   375
  80.          Left            =   360
  81.          TabIndex        =   3
  82.          Top             =   2160
  83.          Width           =   1215
  84.       End
  85.       Begin VB.TextBox Text1 
  86.          Height          =   285
  87.          Left            =   240
  88.          TabIndex        =   1
  89.          Text            =   "c:\test.wav"
  90.          Top             =   480
  91.          Width           =   3255
  92.       End
  93.       Begin VB.Label Label7 
  94.          BackColor       =   &H00FFFFFF&
  95.          BorderStyle     =   1  'Fixed Single
  96.          Caption         =   "label7"
  97.          Height          =   255
  98.          Left            =   1680
  99.          TabIndex        =   18
  100.          Top             =   3120
  101.          Width           =   1815
  102.       End
  103.       Begin VB.Label Label4 
  104.          BorderStyle     =   1  'Fixed Single
  105.          Caption         =   "Length MS:"
  106.          Height          =   255
  107.          Index           =   2
  108.          Left            =   120
  109.          TabIndex        =   17
  110.          Top             =   3120
  111.          Width           =   1575
  112.       End
  113.       Begin VB.Label Label6 
  114.          BackColor       =   &H00FFFFFF&
  115.          BorderStyle     =   1  'Fixed Single
  116.          Caption         =   "label6"
  117.          Height          =   255
  118.          Left            =   1680
  119.          TabIndex        =   16
  120.          Top             =   2880
  121.          Width           =   1815
  122.       End
  123.       Begin VB.Label Label4 
  124.          BorderStyle     =   1  'Fixed Single
  125.          Caption         =   "Length HMS:"
  126.          Height          =   255
  127.          Index           =   1
  128.          Left            =   120
  129.          TabIndex        =   15
  130.          Top             =   2880
  131.          Width           =   1575
  132.       End
  133.       Begin VB.Label Label5 
  134.          BackColor       =   &H00FFFFFF&
  135.          BorderStyle     =   1  'Fixed Single
  136.          Caption         =   "label5"
  137.          Height          =   255
  138.          Left            =   1680
  139.          TabIndex        =   14
  140.          Top             =   2640
  141.          Width           =   1815
  142.       End
  143.       Begin VB.Label Label4 
  144.          BorderStyle     =   1  'Fixed Single
  145.          Caption         =   "State:"
  146.          Height          =   255
  147.          Index           =   0
  148.          Left            =   120
  149.          TabIndex        =   13
  150.          Top             =   2640
  151.          Width           =   1575
  152.       End
  153.       Begin VB.Label Label3 
  154.          BorderStyle     =   1  'Fixed Single
  155.          Caption         =   "Quality Frequency"
  156.          Height          =   255
  157.          Index           =   2
  158.          Left            =   240
  159.          TabIndex        =   9
  160.          Top             =   1680
  161.          Width           =   1455
  162.       End
  163.       Begin VB.Label Label3 
  164.          BorderStyle     =   1  'Fixed Single
  165.          Caption         =   "Quality Channels"
  166.          Height          =   255
  167.          Index           =   1
  168.          Left            =   240
  169.          TabIndex        =   8
  170.          Top             =   1320
  171.          Width           =   1455
  172.       End
  173.       Begin VB.Label Label3 
  174.          BorderStyle     =   1  'Fixed Single
  175.          Caption         =   "Quality Bits"
  176.          Height          =   255
  177.          Index           =   0
  178.          Left            =   240
  179.          TabIndex        =   7
  180.          Top             =   960
  181.          Width           =   1455
  182.       End
  183.       Begin VB.Label Label1 
  184.          BackStyle       =   0  'Transparent
  185.          Caption         =   "Indicate the path and filename to record"
  186.          BeginProperty Font 
  187.             Name            =   "MS Sans Serif"
  188.             Size            =   8.25
  189.             Charset         =   0
  190.             Weight          =   400
  191.             Underline       =   0   'False
  192.             Italic          =   -1  'True
  193.             Strikethrough   =   0   'False
  194.          EndProperty
  195.          Height          =   255
  196.          Left            =   240
  197.          TabIndex        =   2
  198.          Top             =   240
  199.          Width           =   3255
  200.       End
  201.    End
  202.    Begin DynaRecord.DynaRecordX DynaRecordX1 
  203.       Height          =   615
  204.       Left            =   3960
  205.       Top             =   0
  206.       Width           =   615
  207.       _ExtentX        =   1085
  208.       _ExtentY        =   1085
  209.    End
  210. End
  211. Attribute VB_Name = "Form1"
  212. Attribute VB_GlobalNameSpace = False
  213. Attribute VB_Creatable = False
  214. Attribute VB_PredeclaredId = True
  215. Attribute VB_Exposed = False
  216. Option Explicit
  217. Dim Flag As Integer
  218.  
  219. Private Sub Command1_Click()
  220.     
  221.     DynaRecordX1.User_Name = ""
  222.     DynaRecordX1.User_Password = 0
  223.     
  224.     DynaRecordX1.RecFilename = Text1.Text
  225.     DynaRecordX1.RecBits = Val(Combo1.Text)
  226.     DynaRecordX1.RecChannels = Val(Combo2.Text)
  227.     DynaRecordX1.RecFrequency = Val(Combo3.Text)
  228.  
  229.     Flag = DynaRecordX1.Record
  230.     If Flag = 0 Then MsgBox "Record return error"
  231. End Sub
  232.  
  233. Private Sub Command2_Click()
  234.     Flag = DynaRecordX1.StopRec
  235.     If Flag = 0 Then MsgBox "StopRecord return error"
  236.     Label6.Caption = DynaRecordX1.RecLengthHMS
  237.     Label7.Caption = DynaRecordX1.RecLengthMs
  238.  
  239. End Sub
  240.  
  241. Private Sub DynaRecordX1_DynaError(ErrorCode As Long, ErrorString As String)
  242.     Label2.Caption = ErrorString
  243. End Sub
  244.  
  245. Private Sub DynaRecordX1_DynaStateChanged()
  246.     Label5.Caption = DynaRecordX1.RecState
  247.     If Label5.Caption = "recording" Then
  248.         Label5.BackColor = RGB(255, 0, 0)
  249.     Else
  250.         Label5.BackColor = RGB(255, 255, 255)
  251.     End If
  252. End Sub
  253.  
  254. Private Sub Form_Load()
  255.     
  256.     
  257. 'Init Record Quality
  258.     Combo1.AddItem "8"      'Bits
  259.     Combo1.AddItem "16"